/**
 *  This file is part of AugeasWH.
 *
 *  AugeasWH. is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  AugeasWH. is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with AugeasWH.  If not, see <http://www.gnu.org/licenses/>.
 */

package cz.fit.vutbr.pis2012.augeaswh.control.ekonom.discounts;

import java.io.Serializable;
import java.util.List;

import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

import cz.fit.vutbr.pis2012.augeaswh.managers.DiscountsManager;
import cz.fit.vutbr.pis2012.augeaswh.managers.StockTypesManager;
import cz.fit.vutbr.pis2012.augeaswh.persistence.Discount;

@ManagedBean
@SessionScoped
public class DiscountsBean implements Serializable {

	private static final long serialVersionUID = 8383939906648980375L;
	
	@EJB
	private DiscountsManager dm;
	@EJB 
	private StockTypesManager stm;
	
	private final int rowsPerPage;
	private int page;
	
	public DiscountsBean() {
		rowsPerPage = 15;
		page = 1;
	}
	
	public List<Discount> getDiscounts() {
		System.out.println(stm);
		return dm.getDiscounts();
	}
	
	public String editDiscount() {
		return "edit";
	}
	

	public int getRowsPerPage() {
		return rowsPerPage;
	}

	public int getPage() {
		return page;
	}
	
	public void setPage(int page) {
		this.page = page;
	}
}